(define (make-account balance password)
  (define (withdraw amount)
    (if (>= balance amount)
      (begin (set! balance (- balance amount))
             balance)
      "Insufficient funds"))
  (define (verify pwd)
    (if (eq? pwd password) #t (begin (error "Incorrect password") #f)))
  (define (deposit amount)
    (set! balance (+ balance amount))
    balance)
  (define (dispatch p m)
    (cond ((eq? m 'withdraw) (if (eq? (verify p) #t) withdraw))
          ((eq? m 'deposit) (if (eq? (verify p) #t) deposit))
          (else (error "Unknow request -- MAKE-ACCOUNT"))))
  dispatch)
